/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package designpattern.FactoryPattern;

/**
 *
 * @author Mcdonald
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Factory factory = new Factory();
        IDatabase database = (IDatabase)factory.returnDB("oracle");
        database.connection();
        
        /*
        如果这里不用工厂模式实例化数据库对象的话
        当需要将mysql换成oracle的时候
        就不是把字符串mysql改成oracle这么简单的操作就好了
        */
    }
    
}
